package com.xinqi.modules.prepare.prepare.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.xinqi.common.base.annotations.Describe;
import com.xinqi.common.base.enums.BaseEnum;
import lombok.Getter;

/**
 * 资料类型
 * <p>
 * 资料类型，FILE:文件；URL:外连地址
 * </p>
 *
 * @author linkai
 * @date 2023/03/19
 */
@Describe("资料类型")
public enum PrepareDataTypeEnum implements BaseEnum {

    FILE("FILE", "文件"),
    URL("URL", "外连地址"),
    ;

    @Getter(onMethod_ = {@JsonValue})
    private final String code;

    @Getter
    private final String describe;

    PrepareDataTypeEnum(String code, String describe) {
        this.code = code;
        this.describe = describe;
    }

    @JsonCreator
    public static PrepareDataTypeEnum of(String code) {
        return BaseEnum.of(PrepareDataTypeEnum.class, code);
    }

}
